<template>
  <div>
    小明期末成绩成绩为：
    <p v-if="type === 'a'">优秀</p>
    <p v-else-if="type === 'b'">良好</p>
    <p v-else>差</p>
    <button @click="type = 'a'">优秀</button>
    <button @click="type = 'b'">中等</button>
    <button @click="type = 'c'">差劲</button>
  </div>
</template>

<script setup>
import { ref } from "vue";
const type = ref("");
</script>

<style lang="scss" scoped></style>
